package com.ddh.codeduck.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.codeduck.pojo.dto.CodeDuckUserDTO;
import com.codeduck.pojo.dto.CodeDuckUserPwdDTO;
import com.codeduck.pojo.entity.CodeDuckUser;
import com.codeduck.pojo.req.CodeDuckUserPageReq;
import com.codeduck.pojo.vo.CodeDuckUserVO;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author ddh
 * @since 2025-07-02
 */
public interface ICodeDuckUserService extends IService<CodeDuckUser> {

    /**
     * 用户注册
     *
     * @param cardUserRegisterDTO
     * @return
     */
    boolean register(CodeDuckUserDTO cardUserRegisterDTO);

    /**
     * 用户登录
     *
     * @param cardUserRegisterDTO
     * @return
     */
    CodeDuckUserVO login(CodeDuckUserDTO cardUserRegisterDTO);

    /**
     * 查询所有用户
     *
     * @return
     */
    IPage<CodeDuckUserVO> listUser(CodeDuckUserPageReq codeDuckUserPageReq);

    /**
     * 根据token查询用户
     *
     * @return
     */
    CodeDuckUserVO getByToken();

    Boolean logout();

    Boolean mySaveOrUpdate(CodeDuckUser codeDuckUser);

    /**
     * 重置密码
     * @param codeDuckUserPwdDTO
     * @return
     */
    Boolean resetPassword(CodeDuckUserPwdDTO codeDuckUserPwdDTO);
}
